
#include "ModulsManager\ClassADOmodul.h"



/****************************************************************************************************/
/*                           A I N _ M O D U L E      C O N S T R U C T O R                         */
/****************************************************************************************************/
ADOmodul::ADOmodul(uint8_t devID, uint8_t modKey, ADoData *pResult) : BASEmodul(devID,modKey)
{
  pData = pResult;
}


STATUS_MODUL ADOmodul::ReadCHvals(void)
{
  STATUS_MODUL status;
  uint32_t ch;
//
  status = RdMod(aDAC,NofAOMax<<1);
  if(status==ALL_RIGHT)
   { 
     for(ch=0; ch<NofAOMax; ++ch)
      {  pData->AO_Val[ch] = BufToUSHT(ch<<1);  }
   }
  status = RdMod(aRelaySt,2);
  if(status==ALL_RIGHT)
   { 
     pData->RO_State = BufToCHAR(0);
     pData->DO_State = BufToCHAR(0);
   }
//
  return status;
}



STATUS_MODUL ADOmodul::SetUpModul(void)
{
  STATUS_MODUL status;
//
  status = ReadModInfo(MinModTypeADO);
  if(status==ALL_RIGHT)
    { /*WrCR1(WrFALSH);*/  WrKey(); }
//
  return status;
}



